App({
  globalData: {
    userInfo: null,
    apiConfig: {
      douyin: 'https://api.pearktrue.cn/api/video/douyin/parse/',
      kuaishou: 'https://api.pearktrue.cn/api/video/kuaishou/parse/'
    },
    videoPatterns: {
      douyin: [
        /http[s]?:\/\/(?:[\w-]+\.)?douyin\.com\/video\/(\d+)/i,
        /http[s]?:\/\/(?:[\w-]+\.)?douyin\.com\/share\/video\/(\d+)/i,
        /http[s]?:\/\/(?:[\w-]+\.)?douyin\.com\/.*modal_id=(\d+)/i,
        /http[s]?:\/\/v\.douyin\.com\/\w+/i
      ],
      kuaishou: /http[s]?:\/\/(?:[\w-]+\.)?kuaishou\.com\/[^\s<>"']+/i
    }
  },

 
  onLaunch() {
    // 展示本地存储能力
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)

    // 登录
    wx.login({
      success: res => {
        // 发送 res.code 到后台换取 openId, sessionKey, unionId
      }
    })
  }
})
